<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang xml:lang>
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  <title>readme</title>
  <style type="text/css">
      code{white-space: pre-wrap;}
      span.smallcaps{font-variant: small-caps;}
      span.underline{text-decoration: underline;}
      div.column{display: inline-block; vertical-align: top; width: 50%;}
  </style>
  <!--[if lt IE 9]>
    <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
  <![endif]-->
</head>
<body>
<h1 id="plantuml-pandoc-filter">PlantUML Pandoc filter</h1>
<p>PlantUML Pandoc filter to process code blocks with class “plantuml” containing PlantUML notation into images.</p>
<ul>
<li>For textual output formats, use –extract-media=DIR</li>
<li>For HTML formats, you may alternatively use –self-contained</li>
</ul>
<h2 id="example-in-markdown-file">Example in markdown-file</h2>
<p><img src="" alt="PlantUML Diagramm" /></p>
<h2 id="run-pandoc">Run pandoc</h2>
<pre><code>pandoc --self-contained --lua-filter=plantuml.lua readme.md -o output.htm</code></pre>
<h2 id="prerequisites">Prerequisites</h2>
<ul>
<li>download PlantUML from http://plantuml.com (needs JAVA)</li>
<li>3 ways to set the environment
<ol type="1">
<li>plantuml.lua and plantuml.jar in the same folder and start pandoc always from this folder</li>
<li>set a Environment Variable PLANTUML with the path to plantuml.jar
<ul>
<li>Windows - with powershell: Set-Item env:PLANTUML “c:.jar”</li>
</ul></li>
<li>change path to plantuml.jar in plantuml.lua</li>
</ol></li>
</ul>
<p>This script based on the example “Converting ABC code to music notation” from https://pandoc.org/lua-filters.html</p>
<p>This script was only tested with markdown to html on a windows environment!</p>
</body>
</html>
